<?php
// Import of base class
require_once ("Fork.php");
// number of executeThreads we want


define ("NUM_THREAD", 2);
// Class definition; this class have a very basic purpose,, it simply
// has an inernal counter and increment it every each second...
class executeThread extends PHP_Fork {
    var $counter;

    function executeThread($name)
    {
        $this->PHP_Fork($name);
        $this->counter = 0;
    } 

    function run()
    {
		echo "Dsad";
        $i = 0;
        while ($i < 10) {
            print time() . "-(" . $this->getName() . ")-" . $this->counter++ . "\n";
            sleep(1);
            $i++;
        } 
    } 
} 
// Main program. Bring up NUM_THREAD instances of the executeThread class that
// runs concurrently. It's a multi-thread app with a few lines of code!!!
for ($i = 0;$i < NUM_THREAD;$i++) {

	$executeThread[$i] = new executeThread ("executeThread-" . $i);
    $executeThread[$i]->start();
    echo "Started " . $executeThread[$i]->getName() . " with PID " . $executeThread[$i]->getPid() . "...\n";
} 

echo "\nThis is the main process.\nNothing to do, so exit...\n";

?>
